﻿using Castle.ActiveRecord;
using NHibernate;

namespace WeatherModel
{
    public class ModelGlobal
    {
        private static ISession _Session;
        /// <summary>
        /// 整个项目的查询Session
        /// </summary>
        public static ISession MainSession
        {
            get
            {
                if (_Session == null)
                {
                    _Session = ActiveRecordMediator.GetSessionFactoryHolder().CreateSession(typeof(ActiveRecordBase));
                }
                return _Session;
            }
        }

        public static WeatherTime MyWeatherTime { get; set; }
    }
}